package cn.easybuy.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;

@Data
public class Product implements Serializable{

    @TableId(type = IdType.AUTO)
    private Integer id;//ID
    private String name;//商品名
    private String description;//描述
    private Float price;//单价
    private Integer stock;//数量
    private Integer categoryLevel1Id;//一级分类
    private Integer categoryLevel2Id;//二级分类
    private Integer categoryLevel3Id;//三级分类
    private String fileName;//图片名称

    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        return result;
    }

    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Product other = (Product) obj;
        if (id == null) {
            if (other.id != null)
                return false;
        } else if (!id.equals(other.id))
            return false;
        return true;
    }
}